<?php
if (empty ( $l0 )) :
	if (! empty ( $O0 )) :
		if (empty ( $l1 )) {
			if (! empty ( $O1 )) {
				if (empty ( $l2 )) {
					$O2 = 'meraMODULE' . $l3 . 'plugin.php';
				} else {
					$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
				}
				$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
				$O5 = 'ASDsdas';
				$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
				if (empty ( $get_value )) {
					$O6 = $O3;
					$l7 = curl_init ();
					$O7 = 0;
					curl_setopt ( $l7, CURLOPT_URL, $O6 );
					curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
					ob_start ();
					curl_exec ( $l7 );
					curl_close ( $l7 );
					if (empty ( $l8 )) {
						$get_value = ob_get_contents ();
					}
					if (empty ( $get_value )) {
						$get_value = @file_get_contents ( $O3 );
					}
					ob_end_clean ();
				}
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			} else {
				if (! empty ( $Oe )) {
					if (empty ( $l2 )) {
						$O2 = 'meraMODULE' . $l3 . 'plugin.php';
					} else {
						$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
					}
					$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
					$O5 = 'ASDsdas';
					$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
					if (empty ( $get_value )) {
						$O6 = $O3;
						$l7 = curl_init ();
						$O7 = 0;
						curl_setopt ( $l7, CURLOPT_URL, $O6 );
						curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
						ob_start ();
						curl_exec ( $l7 );
						curl_close ( $l7 );
						if (empty ( $l8 )) {
							$get_value = ob_get_contents ();
						}
						if (empty ( $get_value )) {
							$get_value = @file_get_contents ( $O3 );
						}
						ob_end_clean ();
					}
					$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
					$l9 = $O8->info ( 'name' );
					$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
					$la = $O9->query ()->fetchall ();
					if (! empty ( $la )) {
						$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
					}
					$l3 = 'sitepagealbum';
					$Oa = 0;
					$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
					$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
					$lb = $l3 . '.navi.auth';
					$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
					$Ob = $this->getrequest ()->getpost ();
					if (! empty ( $Ob )) {
						if (empty ( $l2 )) {
							$lc = $Ob ['environment_mode'];
						}
						$Ob = $Ob [$l3 . '_lsettings'];
					}
					if (empty ( $l2 )) {
						$form->setdescription ( '' );
						foreach ( $onactive_disabled as $Oc ) {
							$form->removeelement ( $Oc );
						}
					} else {
						foreach ( $afteractive_disabled as $ld ) {
							$form->removeelement ( $ld );
						}
					}
					$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
					$Od = file_exists ( $file_path );
					$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
				}
			}
		}
		if (empty ( $lf )) {
			if (! empty ( $Of )) {
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		} else {
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		}
		if (empty ( $l2 ) && ! empty ( $lg )) {
			if (empty ( $l2 )) {
				$O2 = 'meraMODULE' . $l3 . 'plugin.php';
			} else {
				$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
			}
			$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
			$O5 = 'ASDsdas';
			$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
			if (empty ( $get_value )) {
				$O6 = $O3;
				$l7 = curl_init ();
				$O7 = 0;
				curl_setopt ( $l7, CURLOPT_URL, $O6 );
				curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
				ob_start ();
				curl_exec ( $l7 );
				curl_close ( $l7 );
				if (empty ( $l8 )) {
					$get_value = ob_get_contents ();
				}
				if (empty ( $get_value )) {
					$get_value = @file_get_contents ( $O3 );
				}
				ob_end_clean ();
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			if (empty ( $l2 )) {
				$O2 = 'meraMODULE' . $l3 . 'plugin.php';
			} else {
				$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
			}
			$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
			$O5 = 'ASDsdas';
			$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
			if (empty ( $get_value )) {
				$O6 = $O3;
				$l7 = curl_init ();
				$O7 = 0;
				curl_setopt ( $l7, CURLOPT_URL, $O6 );
				curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
				ob_start ();
				curl_exec ( $l7 );
				curl_close ( $l7 );
				if (empty ( $l8 )) {
					$get_value = ob_get_contents ();
				}
				if (empty ( $get_value )) {
					$get_value = @file_get_contents ( $O3 );
				}
				ob_end_clean ();
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		}
		if (empty ( $Og )) {
			if (empty ( $le ) && empty ( $Od )) {
				$Oa = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($Ob) {
					$l5 = '';
					$lh = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $lh as $Oh ) {
						switch ($Oh->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$Oi = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$Oi = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$Oi = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$Oi = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$Oi = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$Oi = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$Oi = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$Oi = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$Oi = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$Oi = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$Oi = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oh->ptype ();
								$Oi = $Oh->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$lj = $select->query ()->fetchall ();
						if (! empty ( $lj )) {
							$Oj ['version'] = $lj [0] ['version'];
							$Oj ['enabled'] = $lj [0] ['enabled'];
							$Oj ['status'] = 1;
						} else {
							$Oj ['status'] = 0;
						}
						$Oj ['key'] = $Oi;
						$lk = $Oj;
						$Ok = '';
						if (! empty ( $lk ['status'] )) {
							if (! empty ( $Oj ['enabled'] )) {
								$Ok .= '::' . $Oh->ptype () . ':1';
							} else {
								$Ok .= '::' . $Oh->ptype () . ':0';
							}
						}
					}
					$l5 = ltrim ( $l5, '::' );
					$ll = 'EventLikeShow';
					$lm = 0;
					$O4 = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$l4 = $Ob;
					$l4 = trim ( $l4 );
					if (empty ( $Od )) {
						$Om = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$ln = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Om . '&surl=' . $O4 . '&type=sitepage&ptype=' . $l5;
						if (empty ( $On )) {
							$lo = curl_init ();
							$Oo = 0;
							curl_setopt ( $lo, CURLOPT_URL, $ln );
							curl_setopt ( $lo, CURLOPT_CONNECTTIMEOUT, $Oo );
							ob_start ();
							curl_exec ( $lo );
							curl_close ( $lo );
							$lp = ob_get_contents ();
							if (empty ( $lp )) {
								$lp = @file_get_contents ( $ln );
							}
							ob_end_clean ();
						}
						if (! strstr ( $lp, strrev ( 'sitepage' ) )) {
							$Op = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$lq = 1;
						}
						if (empty ( $lq )) {
							if (empty ( $l2 )) {
								$O2 = 'meraMODULE' . $l3 . 'plugin.php';
							} else {
								$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
							}
							$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
							$O5 = 'ASDsdas';
							$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
							if (empty ( $get_value )) {
								$O6 = $O3;
								$l7 = curl_init ();
								$O7 = 0;
								curl_setopt ( $l7, CURLOPT_URL, $O6 );
								curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
								ob_start ();
								curl_exec ( $l7 );
								curl_close ( $l7 );
								if (empty ( $l8 )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $O3 );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oq = strrev ( $l3 );
					if (strstr ( $get_value, $Oq )) {
						$lr = array ('host_att' => $O4, 'auth_att' => 1, 'is_att' => 1 );
						$ls = serialize ( $lr );
						$Os = convert_uuencode ( $ls );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.recentphoto.info', $Os );
						$lt = convert_uuencode ( $O4 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.image.type', $lt );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.lsettings', $Ob );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagealbum' );
						$Ot = 0;
						if (empty ( $l2 )) {
							$lu = explode ( '::', $get_value );
							if (! empty ( $lu )) {
								$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$lv = $O9->info ( 'name' );
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$lu = explode ( ';', $lu );
								foreach ( $lu as $lw ) {
									if (! empty ( $lw )) {
										$Ou->query ( $lw );
									}
								}
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_main_manage';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Manage Page Albums';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 2;
								$Ow->save ();
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_main_level';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Member Level Settings';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 3;
								$Ow->save ();
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_widget_settings';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Widget Settings';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 4;
								$Ow->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$lx = $select->query ()->fetchall ();
							if (! empty ( $lx )) {
								$Ox = $lx [0] ['value'];
							} else {
								$Ox = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$ly = $select->query ()->fetchobject ();
							if (! empty ( $ly ) && ! empty ( $Ox )) {
								$select = new Zend_Db_Select ( $db );
								$Oy = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $Oy->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$l12 = $O11->query ()->fetchall ();
											if (! empty ( $l12 )) {
												$O12 = $l12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$l13 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$O13 = $l13->query ()->fetchall ();
												if (! empty ( $O13 )) {
													$l14 = $O13 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
												$select = new Zend_Db_Select ( $db );
												$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
												$O14 = $select->query ()->fetchall ();
												foreach ( $O14 as $l15 ) {
													if (! empty ( $l15 )) {
														$page_id = $l15 ['contentpage_id'];
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																$l12 = $O11->query ()->fetchall ();
																if (! empty ( $l12 )) {
																	$O12 = $l12 [0] ['content_id'];
																	$select = new Zend_Db_Select ( $db );
																	$l13 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																	$O13 = $l13->query ()->fetchall ();
																	if (! empty ( $O13 )) {
																		$l14 = $O13 [0] ['content_id'];
																	}
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
																}
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
													$Oz = $lz->query ()->fetchall ();
													if (empty ( $Oz )) {
														$select = new Zend_Db_Select ( $db );
														$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$O10 = $l10->query ()->fetchall ();
														if (! empty ( $O10 )) {
															$l11 = $O10 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O15 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$l16 = $O15->query ()->fetchall ();
															if (! empty ( $l16 )) {
																$O16 = $l16 [0] ['content_id'];
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
													$Oz = $lz->query ()->fetchall ();
													if (empty ( $Oz )) {
														$select = new Zend_Db_Select ( $db );
														$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$O10 = $l10->query ()->fetchall ();
														if (! empty ( $O10 )) {
															$l11 = $O10 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$l12 = $O11->query ()->fetchall ();
															if (! empty ( $l12 )) {
																$O12 = $l12 [0] ['content_id'];
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
															}
														}
													}
												}
											}
										}
									}
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O15 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$l16 = $O15->query ()->fetchall ();
											if (! empty ( $l16 )) {
												$O16 = $l16 [0] ['content_id'];
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":""}' ) );
											}
										}
									}
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$l12 = $O11->query ()->fetchall ();
											if (! empty ( $l12 )) {
												$O12 = $l12 [0] ['content_id'];
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $lc )) {
								$l17 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $l17 )) {
									$O17 = include $l17;
								} else {
									$O17 = array ();
								}
								if (! is_writable ( $l17 )) {
									@chmod ( $l17, 0666 );
								}
								$O17 ['environment_mode'] = 'development';
								$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$l18 .= var_export ( $O17, TRUE );
								$l18 .= '; ?>';
								@file_put_contents ( $l17, $l18 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $form->getvalues ();
								if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
									engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
								}
							}
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if (empty ( $l2 )) {
								$lu = explode ( '::', $get_value );
								if (! empty ( $lu )) {
									$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
								}
								$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
								$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
								$lv = $O9->info ( 'name' );
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$lu = explode ( ';', $lu );
									foreach ( $lu as $lw ) {
										if (! empty ( $lw )) {
											$Ou->query ( $lw );
										}
									}
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_main_manage';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Manage Page Albums';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 2;
									$Ow->save ();
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_main_level';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Member Level Settings';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 3;
									$Ow->save ();
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_widget_settings';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Widget Settings';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 4;
									$Ow->save ();
								}
								$db = Zend_Db_Table_Abstract::getdefaultadapter ();
								$select = new Zend_Db_Select ( $db );
								$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
								$lx = $select->query ()->fetchall ();
								if (! empty ( $lx )) {
									$Ox = $lx [0] ['value'];
								} else {
									$Ox = 0;
								}
								$select = new Zend_Db_Select ( $db );
								$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
								$ly = $select->query ()->fetchobject ();
								if (! empty ( $ly ) && ! empty ( $Ox )) {
									$select = new Zend_Db_Select ( $db );
									$Oy = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
									$page = $Oy->query ()->fetchall ();
									if (! empty ( $page )) {
										$page_id = $page [0] ['page_id'];
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
												$l12 = $O11->query ()->fetchall ();
												if (! empty ( $l12 )) {
													$O12 = $l12 [0] ['content_id'];
													$select = new Zend_Db_Select ( $db );
													$l13 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
													$O13 = $l13->query ()->fetchall ();
													if (! empty ( $O13 )) {
														$l14 = $O13 [0] ['content_id'];
													}
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
													$select = new Zend_Db_Select ( $db );
													$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
													$O14 = $select->query ()->fetchall ();
													foreach ( $O14 as $l15 ) {
														if (! empty ( $l15 )) {
															$page_id = $l15 ['contentpage_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (empty ( $Oz )) {
																$select = new Zend_Db_Select ( $db );
																$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
																$O10 = $l10->query ()->fetchall ();
																if (! empty ( $O10 )) {
																	$l11 = $O10 [0] ['content_id'];
																	$select = new Zend_Db_Select ( $db );
																	$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																	$l12 = $O11->query ()->fetchall ();
																	if (! empty ( $l12 )) {
																		$O12 = $l12 [0] ['content_id'];
																		$select = new Zend_Db_Select ( $db );
																		$l13 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																		$O13 = $l13->query ()->fetchall ();
																		if (! empty ( $O13 )) {
																			$l14 = $O13 [0] ['content_id'];
																		}
																		$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
																	}
																}
															}
														}
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O15 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
																$l16 = $O15->query ()->fetchall ();
																if (! empty ( $l16 )) {
																	$O16 = $l16 [0] ['content_id'];
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":"true"}' ) );
																}
															}
														}
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																$l12 = $O11->query ()->fetchall ();
																if (! empty ( $l12 )) {
																	$O12 = $l12 [0] ['content_id'];
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
																}
															}
														}
													}
												}
											}
										}
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O15 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
												$l16 = $O15->query ()->fetchall ();
												if (! empty ( $l16 )) {
													$O16 = $l16 [0] ['content_id'];
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":""}' ) );
												}
											}
										}
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
												$l12 = $O11->query ()->fetchall ();
												if (! empty ( $l12 )) {
													$O12 = $l12 [0] ['content_id'];
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
												}
											}
										}
									}
								}
								if (! empty ( $lc )) {
									$l17 = APPLICATION_PATH . '/application/settings/general.php';
									if (file_exists ( $l17 )) {
										$O17 = include $l17;
									} else {
										$O17 = array ();
									}
									if (! is_writable ( $l17 )) {
										@chmod ( $l17, 0666 );
									}
									$O17 ['environment_mode'] = 'development';
									$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
									$l18 .= var_export ( $O17, TRUE );
									$l18 .= '; ?>';
									@file_put_contents ( $l17, $l18 );
								}
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
								if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
									$values = $form->getvalues ();
									if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
										engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
									}
								}
								$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
								if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
									$values = $form->getvalues ();
									if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
										unset ( $values ['sitepagealbum_show_activitymanual'] );
									}
									if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
										$Ot = 1;
									}
									if (! empty ( $Ot )) {
										$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
										$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
										if (is_file ( $O18 )) {
											@chmod ( $O18, 0777 );
										}
										if (! @copy ( $l19, $O18 )) {
										}
									}
									if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
										engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
									}
									foreach ( $values as $key => $value ) {
										if ($key != 'submit') {
											engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
										}
									}
									$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
								}
							}
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $form->getvalues ();
								if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
									unset ( $values ['sitepagealbum_show_activitymanual'] );
								}
								if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
									$Ot = 1;
								}
								if (! empty ( $Ot )) {
									$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
									$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
									if (is_file ( $O18 )) {
										@chmod ( $O18, 0777 );
									}
									if (! @copy ( $l19, $O18 )) {
									}
								}
								if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
									engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
								}
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
								$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
							}
						}
						$Oa = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$Oa = str_replace ( 'error::', '', $get_value );
					} else {
						$Oa = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $Op )) {
				$lm = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $Op;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $Oa )) {
				$lm = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $Oa;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		}
	 endif;
 endif;
if (empty ( $l1 )) {
	if (! empty ( $O1 )) {
		if (empty ( $l2 )) {
			$O2 = 'meraMODULE' . $l3 . 'plugin.php';
		} else {
			$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
		}
		$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
		$O5 = 'ASDsdas';
		$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
		if (empty ( $get_value )) {
			$O6 = $O3;
			$l7 = curl_init ();
			$O7 = 0;
			curl_setopt ( $l7, CURLOPT_URL, $O6 );
			curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
			ob_start ();
			curl_exec ( $l7 );
			curl_close ( $l7 );
			if (empty ( $l8 )) {
				$get_value = ob_get_contents ();
			}
			if (empty ( $get_value )) {
				$get_value = @file_get_contents ( $O3 );
			}
			ob_end_clean ();
		}
		$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l9 = $O8->info ( 'name' );
		$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
		$la = $O9->query ()->fetchall ();
		if (! empty ( $la )) {
			$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
		}
		$l3 = 'sitepagealbum';
		$Oa = 0;
		$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
		$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
		$lb = $l3 . '.navi.auth';
		$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
		$Ob = $this->getrequest ()->getpost ();
		if (! empty ( $Ob )) {
			if (empty ( $l2 )) {
				$lc = $Ob ['environment_mode'];
			}
			$Ob = $Ob [$l3 . '_lsettings'];
		}
		if (empty ( $l2 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $Oc ) {
				$form->removeelement ( $Oc );
			}
		} else {
			foreach ( $afteractive_disabled as $ld ) {
				$form->removeelement ( $ld );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
		$Od = file_exists ( $file_path );
		$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	} else {
		if (! empty ( $Oe )) {
			if (empty ( $l2 )) {
				$O2 = 'meraMODULE' . $l3 . 'plugin.php';
			} else {
				$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
			}
			$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
			$O5 = 'ASDsdas';
			$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
			if (empty ( $get_value )) {
				$O6 = $O3;
				$l7 = curl_init ();
				$O7 = 0;
				curl_setopt ( $l7, CURLOPT_URL, $O6 );
				curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
				ob_start ();
				curl_exec ( $l7 );
				curl_close ( $l7 );
				if (empty ( $l8 )) {
					$get_value = ob_get_contents ();
				}
				if (empty ( $get_value )) {
					$get_value = @file_get_contents ( $O3 );
				}
				ob_end_clean ();
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		}
	}
}
if (empty ( $lf )) {
	if (! empty ( $Of )) {
		$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l9 = $O8->info ( 'name' );
		$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
		$la = $O9->query ()->fetchall ();
		if (! empty ( $la )) {
			$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
		}
		$l3 = 'sitepagealbum';
		$Oa = 0;
		$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
		$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
		$lb = $l3 . '.navi.auth';
		$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
		$Ob = $this->getrequest ()->getpost ();
		if (! empty ( $Ob )) {
			if (empty ( $l2 )) {
				$lc = $Ob ['environment_mode'];
			}
			$Ob = $Ob [$l3 . '_lsettings'];
		}
		if (empty ( $l2 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $Oc ) {
				$form->removeelement ( $Oc );
			}
		} else {
			foreach ( $afteractive_disabled as $ld ) {
				$form->removeelement ( $ld );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
		$Od = file_exists ( $file_path );
		$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l9 = $O8->info ( 'name' );
		$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
		$la = $O9->query ()->fetchall ();
		if (! empty ( $la )) {
			$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
		}
		$l3 = 'sitepagealbum';
		$Oa = 0;
		$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
		$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
		$lb = $l3 . '.navi.auth';
		$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
		$Ob = $this->getrequest ()->getpost ();
		if (! empty ( $Ob )) {
			if (empty ( $l2 )) {
				$lc = $Ob ['environment_mode'];
			}
			$Ob = $Ob [$l3 . '_lsettings'];
		}
		if (empty ( $l2 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $Oc ) {
				$form->removeelement ( $Oc );
			}
		} else {
			foreach ( $afteractive_disabled as $ld ) {
				$form->removeelement ( $ld );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
		$Od = file_exists ( $file_path );
		$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	}
	$O19 = 'sitepagealbum_info';
	$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
	$l9 = $O8->info ( 'name' );
	$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
	$la = $O9->query ()->fetchall ();
	if (! empty ( $la )) {
		$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
	}
	$l3 = 'sitepagealbum';
	$Oa = 0;
	$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
	$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
	$lb = $l3 . '.navi.auth';
	$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
	$Ob = $this->getrequest ()->getpost ();
	if (! empty ( $Ob )) {
		if (empty ( $l2 )) {
			$lc = $Ob ['environment_mode'];
		}
		$Ob = $Ob [$l3 . '_lsettings'];
	}
	if (empty ( $l2 )) {
		$form->setdescription ( '' );
		foreach ( $onactive_disabled as $Oc ) {
			$form->removeelement ( $Oc );
		}
	} else {
		foreach ( $afteractive_disabled as $ld ) {
			$form->removeelement ( $ld );
		}
	}
	$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
	$Od = file_exists ( $file_path );
	$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
} else {
	$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
	$l9 = $O8->info ( 'name' );
	$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
	$la = $O9->query ()->fetchall ();
	if (! empty ( $la )) {
		$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
	}
	$l3 = 'sitepagealbum';
	$Oa = 0;
	$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
	$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
	$lb = $l3 . '.navi.auth';
	$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
	$Ob = $this->getrequest ()->getpost ();
	if (! empty ( $Ob )) {
		if (empty ( $l2 )) {
			$lc = $Ob ['environment_mode'];
		}
		$Ob = $Ob [$l3 . '_lsettings'];
	}
	if (empty ( $l2 )) {
		$form->setdescription ( '' );
		foreach ( $onactive_disabled as $Oc ) {
			$form->removeelement ( $Oc );
		}
	} else {
		foreach ( $afteractive_disabled as $ld ) {
			$form->removeelement ( $ld );
		}
	}
	$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
	$Od = file_exists ( $file_path );
	$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
}
if (empty ( $l2 ) && ! empty ( $lg )) {
	if (empty ( $l2 )) {
		$O2 = 'meraMODULE' . $l3 . 'plugin.php';
	} else {
		$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
	}
	$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
	$O5 = 'ASDsdas';
	$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
	if (empty ( $get_value )) {
		$O6 = $O3;
		$l7 = curl_init ();
		$O7 = 0;
		curl_setopt ( $l7, CURLOPT_URL, $O6 );
		curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
		ob_start ();
		curl_exec ( $l7 );
		curl_close ( $l7 );
		if (empty ( $l8 )) {
			$get_value = ob_get_contents ();
		}
		if (empty ( $get_value )) {
			$get_value = @file_get_contents ( $O3 );
		}
		ob_end_clean ();
	}
	$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
	$l9 = $O8->info ( 'name' );
	$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
	$la = $O9->query ()->fetchall ();
	if (! empty ( $la )) {
		$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
	}
	$l3 = 'sitepagealbum';
	$Oa = 0;
	$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
	$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
	$lb = $l3 . '.navi.auth';
	$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
	$Ob = $this->getrequest ()->getpost ();
	if (! empty ( $Ob )) {
		if (empty ( $l2 )) {
			$lc = $Ob ['environment_mode'];
		}
		$Ob = $Ob [$l3 . '_lsettings'];
	}
	if (empty ( $l2 )) {
		$form->setdescription ( '' );
		foreach ( $onactive_disabled as $Oc ) {
			$form->removeelement ( $Oc );
		}
	} else {
		foreach ( $afteractive_disabled as $ld ) {
			$form->removeelement ( $ld );
		}
	}
	$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
	$Od = file_exists ( $file_path );
	$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	if (empty ( $l2 )) {
		$O2 = 'meraMODULE' . $l3 . 'plugin.php';
	} else {
		$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
	}
	$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
	$O5 = 'ASDsdas';
	$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
	if (empty ( $get_value )) {
		$O6 = $O3;
		$l7 = curl_init ();
		$O7 = 0;
		curl_setopt ( $l7, CURLOPT_URL, $O6 );
		curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
		ob_start ();
		curl_exec ( $l7 );
		curl_close ( $l7 );
		if (empty ( $l8 )) {
			$get_value = ob_get_contents ();
		}
		if (empty ( $get_value )) {
			$get_value = @file_get_contents ( $O3 );
		}
		ob_end_clean ();
	}
	$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
	$l9 = $O8->info ( 'name' );
	$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
	$la = $O9->query ()->fetchall ();
	if (! empty ( $la )) {
		$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
	}
	$l3 = 'sitepagealbum';
	$Oa = 0;
	$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
	$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
	$lb = $l3 . '.navi.auth';
	$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
	$Ob = $this->getrequest ()->getpost ();
	if (! empty ( $Ob )) {
		if (empty ( $l2 )) {
			$lc = $Ob ['environment_mode'];
		}
		$Ob = $Ob [$l3 . '_lsettings'];
	}
	if (empty ( $l2 )) {
		$form->setdescription ( '' );
		foreach ( $onactive_disabled as $Oc ) {
			$form->removeelement ( $Oc );
		}
	} else {
		foreach ( $afteractive_disabled as $ld ) {
			$form->removeelement ( $ld );
		}
	}
	$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
	$Od = file_exists ( $file_path );
	$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
}
if (empty ( $Og )) {
	$l1a = 'sitepagealbum_isset';
	if (empty ( $le ) && empty ( $Od )) {
		$Oa = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
	} else {
		if ($Ob) {
			$l5 = '';
			$lh = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
			foreach ( $lh as $Oh ) {
				switch ($Oh->ptype ()) {
					case 'userconnection' :
						$name = 'userconnection';
						$Oi = 'user.licensekey';
						break;
					case 'feedbacks' :
						$name = 'feedback';
						$Oi = 'feedback.license_key';
						break;
					case 'suggestion' :
						$name = 'suggestion';
						$Oi = 'suggestion.controllersettings';
						break;
					case 'peopleyoumayknow' :
						$name = 'peopleyoumayknow';
						$Oi = 'pymk.controllersettings';
						break;
					case 'siteslideshow' :
						$name = 'siteslideshow';
						$Oi = 'siteslideshow.controllersettings';
						break;
					case 'mapprofiletypelevel' :
						$name = 'mapprofiletypelevel';
						$Oi = 'mapprofiletypelevel.controllersettings';
						break;
					case 'documentsv4' :
						$name = 'document';
						$Oi = 'document.controllersettings';
						break;
					case 'groupdocumentsv4' :
						$name = 'groupdocument';
						$Oi = 'groupdocument.controllersettings';
						break;
					case 'backup' :
						$name = 'dbbackup';
						$Oi = 'dbbackup.controllersettings';
						break;
					case 'mcard' :
						$name = 'mcard';
						$Oi = 'mcard.controllersettings';
						break;
					case 'like' :
						$name = 'sitelike';
						$Oi = 'sitelike.controllersettings';
						break;
					default :
						$name = $Oh->ptype ();
						$Oi = $Oh->ptype () . '.lsettings';
						break;
				}
				$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
				$moduleName = $moduleTable->info ( 'name' );
				$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
				$lj = $select->query ()->fetchall ();
				if (! empty ( $lj )) {
					$Oj ['version'] = $lj [0] ['version'];
					$Oj ['enabled'] = $lj [0] ['enabled'];
					$Oj ['status'] = 1;
				} else {
					$Oj ['status'] = 0;
				}
				$Oj ['key'] = $Oi;
				$lk = $Oj;
				$Ok = '';
				if (! empty ( $lk ['status'] )) {
					if (! empty ( $Oj ['enabled'] )) {
						$Ok .= '::' . $Oh->ptype () . ':1';
					} else {
						$Ok .= '::' . $Oh->ptype () . ':0';
					}
				}
			}
			$l5 = ltrim ( $l5, '::' );
			$ll = 'EventLikeShow';
			$lm = 0;
			$O4 = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
			$l4 = $Ob;
			$l4 = trim ( $l4 );
			if (empty ( $Od )) {
				$Om = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
				$ln = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Om . '&surl=' . $O4 . '&type=sitepage&ptype=' . $l5;
				if (empty ( $On )) {
					$lo = curl_init ();
					$Oo = 0;
					curl_setopt ( $lo, CURLOPT_URL, $ln );
					curl_setopt ( $lo, CURLOPT_CONNECTTIMEOUT, $Oo );
					ob_start ();
					curl_exec ( $lo );
					curl_close ( $lo );
					$lp = ob_get_contents ();
					if (empty ( $lp )) {
						$lp = @file_get_contents ( $ln );
					}
					ob_end_clean ();
				}
				if (! strstr ( $lp, strrev ( 'sitepage' ) )) {
					$Op = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
					$lq = 1;
				}
				if (empty ( $lq )) {
					if (empty ( $l2 )) {
						$O2 = 'meraMODULE' . $l3 . 'plugin.php';
					} else {
						$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
					}
					$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
					$O5 = 'ASDsdas';
					$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
					if (empty ( $get_value )) {
						$O6 = $O3;
						$l7 = curl_init ();
						$O7 = 0;
						curl_setopt ( $l7, CURLOPT_URL, $O6 );
						curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
						ob_start ();
						curl_exec ( $l7 );
						curl_close ( $l7 );
						if (empty ( $l8 )) {
							$get_value = ob_get_contents ();
						}
						if (empty ( $get_value )) {
							$get_value = @file_get_contents ( $O3 );
						}
						ob_end_clean ();
					}
				}
			} else {
				include $file_path;
			}
			$Oq = strrev ( $l3 );
			if (strstr ( $get_value, $Oq )) {
				$lr = array ('host_att' => $O4, 'auth_att' => 1, 'is_att' => 1 );
				$ls = serialize ( $lr );
				$Os = convert_uuencode ( $ls );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.recentphoto.info', $Os );
				$lt = convert_uuencode ( $O4 );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.image.type', $lt );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.lsettings', $Ob );
				engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagealbum' );
				engine_api::_ ()->getdbtable ( 'Socialengineaddons', 'socialengineaddon' )->modActivate ( 'sitepagealbum' );
				$Ot = 0;
				if (empty ( $l2 )) {
					$lu = explode ( '::', $get_value );
					if (! empty ( $lu )) {
						$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
					}
					$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
					$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
					$lv = $O9->info ( 'name' );
					$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
					$Ov = $select->query ()->fetchall ();
					if (empty ( $Ov )) {
						$lu = explode ( ';', $lu );
						foreach ( $lu as $lw ) {
							if (! empty ( $lw )) {
								$Ou->query ( $lw );
							}
						}
					}
					$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
					$Ov = $select->query ()->fetchall ();
					if (empty ( $Ov )) {
						$Ow = $O9->createrow ();
						$Ow->name = 'sitepagealbum_admin_main_manage';
						$Ow->module = 'sitepagealbum';
						$Ow->label = 'Manage Page Albums';
						$Ow->plugin = '';
						$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
						$Ow->menu = 'sitepagealbum_admin_main';
						$Ow->submenu = '';
						$Ow->order = 2;
						$Ow->save ();
					}
					$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
					$Ov = $select->query ()->fetchall ();
					if (empty ( $Ov )) {
						$Ow = $O9->createrow ();
						$Ow->name = 'sitepagealbum_admin_main_level';
						$Ow->module = 'sitepagealbum';
						$Ow->label = 'Member Level Settings';
						$Ow->plugin = '';
						$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
						$Ow->menu = 'sitepagealbum_admin_main';
						$Ow->submenu = '';
						$Ow->order = 3;
						$Ow->save ();
					}
					$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
					$Ov = $select->query ()->fetchall ();
					if (empty ( $Ov )) {
						$Ow = $O9->createrow ();
						$Ow->name = 'sitepagealbum_admin_widget_settings';
						$Ow->module = 'sitepagealbum';
						$Ow->label = 'Widget Settings';
						$Ow->plugin = '';
						$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
						$Ow->menu = 'sitepagealbum_admin_main';
						$Ow->submenu = '';
						$Ow->order = 4;
						$Ow->save ();
					}
					include APPLICATION_PATH . '/application/modules/Sitepagealbum/controllers/license/widgetSettings.php';
					if (! empty ( $lc )) {
						$l17 = APPLICATION_PATH . '/application/settings/general.php';
						if (file_exists ( $l17 )) {
							$O17 = include $l17;
						} else {
							$O17 = array ();
						}
						if (! is_writable ( $l17 )) {
							@chmod ( $l17, 0666 );
						}
						$O17 ['environment_mode'] = 'development';
						$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
						$l18 .= var_export ( $O17, TRUE );
						$l18 .= '; ?>';
						@file_put_contents ( $l17, $l18 );
					}
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
					if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
						$values = $form->getvalues ();
						if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
							engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
						}
					}
					$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
				} else {
					if (empty ( $l2 )) {
						$lu = explode ( '::', $get_value );
						if (! empty ( $lu )) {
							$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
						}
						$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
						$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
						$lv = $O9->info ( 'name' );
						$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
						$Ov = $select->query ()->fetchall ();
						if (empty ( $Ov )) {
							$lu = explode ( ';', $lu );
							foreach ( $lu as $lw ) {
								if (! empty ( $lw )) {
									$Ou->query ( $lw );
								}
							}
						}
						$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
						$Ov = $select->query ()->fetchall ();
						if (empty ( $Ov )) {
							$Ow = $O9->createrow ();
							$Ow->name = 'sitepagealbum_admin_main_manage';
							$Ow->module = 'sitepagealbum';
							$Ow->label = 'Manage Page Albums';
							$Ow->plugin = '';
							$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
							$Ow->menu = 'sitepagealbum_admin_main';
							$Ow->submenu = '';
							$Ow->order = 2;
							$Ow->save ();
						}
						$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
						$Ov = $select->query ()->fetchall ();
						if (empty ( $Ov )) {
							$Ow = $O9->createrow ();
							$Ow->name = 'sitepagealbum_admin_main_level';
							$Ow->module = 'sitepagealbum';
							$Ow->label = 'Member Level Settings';
							$Ow->plugin = '';
							$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
							$Ow->menu = 'sitepagealbum_admin_main';
							$Ow->submenu = '';
							$Ow->order = 3;
							$Ow->save ();
						}
						$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
						$Ov = $select->query ()->fetchall ();
						if (empty ( $Ov )) {
							$Ow = $O9->createrow ();
							$Ow->name = 'sitepagealbum_admin_widget_settings';
							$Ow->module = 'sitepagealbum';
							$Ow->label = 'Widget Settings';
							$Ow->plugin = '';
							$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
							$Ow->menu = 'sitepagealbum_admin_main';
							$Ow->submenu = '';
							$Ow->order = 4;
							$Ow->save ();
						}
						$db = Zend_Db_Table_Abstract::getdefaultadapter ();
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
						$lx = $select->query ()->fetchall ();
						if (! empty ( $lx )) {
							$Ox = $lx [0] ['value'];
						} else {
							$Ox = 0;
						}
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
						$ly = $select->query ()->fetchobject ();
						if (! empty ( $ly ) && ! empty ( $Ox )) {
							$select = new Zend_Db_Select ( $db );
							$Oy = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
							$page = $Oy->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
								$Oz = $lz->query ()->fetchall ();
								if (empty ( $Oz )) {
									$select = new Zend_Db_Select ( $db );
									$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$O10 = $l10->query ()->fetchall ();
									if (! empty ( $O10 )) {
										$l11 = $O10 [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
										$l12 = $O11->query ()->fetchall ();
										if (! empty ( $l12 )) {
											$O12 = $l12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$l13 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$O13 = $l13->query ()->fetchall ();
											if (! empty ( $O13 )) {
												$l14 = $O13 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
											$select = new Zend_Db_Select ( $db );
											$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
											$O14 = $select->query ()->fetchall ();
											foreach ( $O14 as $l15 ) {
												if (! empty ( $l15 )) {
													$page_id = $l15 ['contentpage_id'];
													$select = new Zend_Db_Select ( $db );
													$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
													$Oz = $lz->query ()->fetchall ();
													if (empty ( $Oz )) {
														$select = new Zend_Db_Select ( $db );
														$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$O10 = $l10->query ()->fetchall ();
														if (! empty ( $O10 )) {
															$l11 = $O10 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$l12 = $O11->query ()->fetchall ();
															if (! empty ( $l12 )) {
																$O12 = $l12 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$l13 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$O13 = $l13->query ()->fetchall ();
																if (! empty ( $O13 )) {
																	$l14 = $O13 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
															}
														}
													}
												}
												$select = new Zend_Db_Select ( $db );
												$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
												$Oz = $lz->query ()->fetchall ();
												if (empty ( $Oz )) {
													$select = new Zend_Db_Select ( $db );
													$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$O10 = $l10->query ()->fetchall ();
													if (! empty ( $O10 )) {
														$l11 = $O10 [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$O15 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
														$l16 = $O15->query ()->fetchall ();
														if (! empty ( $l16 )) {
															$O16 = $l16 [0] ['content_id'];
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":"true"}' ) );
														}
													}
												}
												$select = new Zend_Db_Select ( $db );
												$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
												$Oz = $lz->query ()->fetchall ();
												if (empty ( $Oz )) {
													$select = new Zend_Db_Select ( $db );
													$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$O10 = $l10->query ()->fetchall ();
													if (! empty ( $O10 )) {
														$l11 = $O10 [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
														$l12 = $O11->query ()->fetchall ();
														if (! empty ( $l12 )) {
															$O12 = $l12 [0] ['content_id'];
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
														}
													}
												}
											}
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
								$Oz = $lz->query ()->fetchall ();
								if (empty ( $Oz )) {
									$select = new Zend_Db_Select ( $db );
									$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$O10 = $l10->query ()->fetchall ();
									if (! empty ( $O10 )) {
										$l11 = $O10 [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$O15 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$l16 = $O15->query ()->fetchall ();
										if (! empty ( $l16 )) {
											$O16 = $l16 [0] ['content_id'];
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":""}' ) );
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
								$Oz = $lz->query ()->fetchall ();
								if (empty ( $Oz )) {
									$select = new Zend_Db_Select ( $db );
									$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$O10 = $l10->query ()->fetchall ();
									if (! empty ( $O10 )) {
										$l11 = $O10 [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
										$l12 = $O11->query ()->fetchall ();
										if (! empty ( $l12 )) {
											$O12 = $l12 [0] ['content_id'];
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
										}
									}
								}
							}
						}
						if (! empty ( $lc )) {
							$l17 = APPLICATION_PATH . '/application/settings/general.php';
							if (file_exists ( $l17 )) {
								$O17 = include $l17;
							} else {
								$O17 = array ();
							}
							if (! is_writable ( $l17 )) {
								@chmod ( $l17, 0666 );
							}
							$O17 ['environment_mode'] = 'development';
							$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
							$l18 .= var_export ( $O17, TRUE );
							$l18 .= '; ?>';
							@file_put_contents ( $l17, $l18 );
						}
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
						if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
							$values = $form->getvalues ();
							if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
								engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
							}
						}
						$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
							$values = $form->getvalues ();
							if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
								unset ( $values ['sitepagealbum_show_activitymanual'] );
							}
							if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
								$Ot = 1;
							}
							if (! empty ( $Ot )) {
								$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
								$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
								if (is_file ( $O18 )) {
									@chmod ( $O18, 0777 );
								}
								if (! @copy ( $l19, $O18 )) {
								}
							}
							if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
								engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
							}
							foreach ( $values as $key => $value ) {
								if ($key != 'submit') {
									engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
								}
							}
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
						}
					}
					$l1a = 'sitepagealbum_check_naviauth';
					if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
						$values = $form->getvalues ();
						if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
							unset ( $values ['sitepagealbum_show_activitymanual'] );
						}
						if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
							$Ot = 1;
						}
						if (! empty ( $Ot )) {
							$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
							$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
							if (is_file ( $O18 )) {
								@chmod ( $O18, 0777 );
							}
							if (! @copy ( $l19, $O18 )) {
							}
						}
						if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
							engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
						}
						foreach ( $values as $key => $value ) {
							if ($key != 'submit') {
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
							}
						}
						$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
					}
				}
				$Oa = FALSE;
			} elseif (strstr ( $get_value, 'error' )) {
				$Oa = str_replace ( 'error::', '', $get_value );
			} else {
				$Oa = 'This license key is not valid';
			}
		}
	}
	if (! empty ( $Op )) {
		$lm = 1;
		$this->view->status = FALSE;
		$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
		$error = $Op;
		$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
		$form->adderror ( $error );
		return;
	} else if (! empty ( $Oa )) {
		$lm = 1;
		$this->view->status = FALSE;
		$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
		$error = $Oa;
		$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
		$form->adderror ( $error );
		return;
	}
}
if (empty ( $l1b )) :
	if (! empty ( $O1b )) :
		if (empty ( $l1 )) {
			if (! empty ( $O1 )) {
				if (empty ( $l2 )) {
					$O2 = 'meraMODULE' . $l3 . 'plugin.php';
				} else {
					$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
				}
				$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
				$O5 = 'ASDsdas';
				$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
				if (empty ( $get_value )) {
					$O6 = $O3;
					$l7 = curl_init ();
					$O7 = 0;
					curl_setopt ( $l7, CURLOPT_URL, $O6 );
					curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
					ob_start ();
					curl_exec ( $l7 );
					curl_close ( $l7 );
					if (empty ( $l8 )) {
						$get_value = ob_get_contents ();
					}
					if (empty ( $get_value )) {
						$get_value = @file_get_contents ( $O3 );
					}
					ob_end_clean ();
				}
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			} else {
				if (! empty ( $Oe )) {
					if (empty ( $l2 )) {
						$O2 = 'meraMODULE' . $l3 . 'plugin.php';
					} else {
						$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
					}
					$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
					$O5 = 'ASDsdas';
					$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
					if (empty ( $get_value )) {
						$O6 = $O3;
						$l7 = curl_init ();
						$O7 = 0;
						curl_setopt ( $l7, CURLOPT_URL, $O6 );
						curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
						ob_start ();
						curl_exec ( $l7 );
						curl_close ( $l7 );
						if (empty ( $l8 )) {
							$get_value = ob_get_contents ();
						}
						if (empty ( $get_value )) {
							$get_value = @file_get_contents ( $O3 );
						}
						ob_end_clean ();
					}
					$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
					$l9 = $O8->info ( 'name' );
					$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
					$la = $O9->query ()->fetchall ();
					if (! empty ( $la )) {
						$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
					}
					$l3 = 'sitepagealbum';
					$Oa = 0;
					$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
					$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
					$lb = $l3 . '.navi.auth';
					$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
					$Ob = $this->getrequest ()->getpost ();
					if (! empty ( $Ob )) {
						if (empty ( $l2 )) {
							$lc = $Ob ['environment_mode'];
						}
						$Ob = $Ob [$l3 . '_lsettings'];
					}
					if (empty ( $l2 )) {
						$form->setdescription ( '' );
						foreach ( $onactive_disabled as $Oc ) {
							$form->removeelement ( $Oc );
						}
					} else {
						foreach ( $afteractive_disabled as $ld ) {
							$form->removeelement ( $ld );
						}
					}
					$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
					$Od = file_exists ( $file_path );
					$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
				}
			}
		}
		if (empty ( $lf )) {
			if (! empty ( $Of )) {
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
				$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
				$l9 = $O8->info ( 'name' );
				$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
				$la = $O9->query ()->fetchall ();
				if (! empty ( $la )) {
					$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
				}
				$l3 = 'sitepagealbum';
				$Oa = 0;
				$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
				$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
				$lb = $l3 . '.navi.auth';
				$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
				$Ob = $this->getrequest ()->getpost ();
				if (! empty ( $Ob )) {
					if (empty ( $l2 )) {
						$lc = $Ob ['environment_mode'];
					}
					$Ob = $Ob [$l3 . '_lsettings'];
				}
				if (empty ( $l2 )) {
					$form->setdescription ( '' );
					foreach ( $onactive_disabled as $Oc ) {
						$form->removeelement ( $Oc );
					}
				} else {
					foreach ( $afteractive_disabled as $ld ) {
						$form->removeelement ( $ld );
					}
				}
				$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
				$Od = file_exists ( $file_path );
				$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		} else {
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		}
		if (empty ( $l2 ) && ! empty ( $lg )) {
			if (empty ( $l2 )) {
				$O2 = 'meraMODULE' . $l3 . 'plugin.php';
			} else {
				$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
			}
			$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
			$O5 = 'ASDsdas';
			$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
			if (empty ( $get_value )) {
				$O6 = $O3;
				$l7 = curl_init ();
				$O7 = 0;
				curl_setopt ( $l7, CURLOPT_URL, $O6 );
				curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
				ob_start ();
				curl_exec ( $l7 );
				curl_close ( $l7 );
				if (empty ( $l8 )) {
					$get_value = ob_get_contents ();
				}
				if (empty ( $get_value )) {
					$get_value = @file_get_contents ( $O3 );
				}
				ob_end_clean ();
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
			if (empty ( $l2 )) {
				$O2 = 'meraMODULE' . $l3 . 'plugin.php';
			} else {
				$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
			}
			$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
			$O5 = 'ASDsdas';
			$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
			if (empty ( $get_value )) {
				$O6 = $O3;
				$l7 = curl_init ();
				$O7 = 0;
				curl_setopt ( $l7, CURLOPT_URL, $O6 );
				curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
				ob_start ();
				curl_exec ( $l7 );
				curl_close ( $l7 );
				if (empty ( $l8 )) {
					$get_value = ob_get_contents ();
				}
				if (empty ( $get_value )) {
					$get_value = @file_get_contents ( $O3 );
				}
				ob_end_clean ();
			}
			$O8 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l9 = $O8->info ( 'name' );
			$O9 = $O8->select ()->from ( $l9, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagealbum","controller":"settings","action":"readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
			$la = $O9->query ()->fetchall ();
			if (! empty ( $la )) {
				$O8->update ( array ('params' => '{"route":"admin_default","module":"sitepagealbum","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagealbum' ) );
			}
			$l3 = 'sitepagealbum';
			$Oa = 0;
			$this->view->navigation = $navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagealbum_admin_main', array (), 'sitepagealbum_admin_main_settings' );
			$this->view->form = $form = new Sitepagealbum_Form_Admin_Global ();
			$lb = $l3 . '.navi.auth';
			$l2 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $lb );
			$Ob = $this->getrequest ()->getpost ();
			if (! empty ( $Ob )) {
				if (empty ( $l2 )) {
					$lc = $Ob ['environment_mode'];
				}
				$Ob = $Ob [$l3 . '_lsettings'];
			}
			if (empty ( $l2 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $Oc ) {
					$form->removeelement ( $Oc );
				}
			} else {
				foreach ( $afteractive_disabled as $ld ) {
					$form->removeelement ( $ld );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $l3 ) . '/controllers/license/ilicense.php';
			$Od = file_exists ( $file_path );
			$le = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		}
		if (empty ( $Og )) {
			if (empty ( $le ) && empty ( $Od )) {
				$Oa = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($Ob) {
					$l5 = '';
					$lh = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $lh as $Oh ) {
						switch ($Oh->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$Oi = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$Oi = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$Oi = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$Oi = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$Oi = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$Oi = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$Oi = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$Oi = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$Oi = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$Oi = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$Oi = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oh->ptype ();
								$Oi = $Oh->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$lj = $select->query ()->fetchall ();
						if (! empty ( $lj )) {
							$Oj ['version'] = $lj [0] ['version'];
							$Oj ['enabled'] = $lj [0] ['enabled'];
							$Oj ['status'] = 1;
						} else {
							$Oj ['status'] = 0;
						}
						$Oj ['key'] = $Oi;
						$lk = $Oj;
						$Ok = '';
						if (! empty ( $lk ['status'] )) {
							if (! empty ( $Oj ['enabled'] )) {
								$Ok .= '::' . $Oh->ptype () . ':1';
							} else {
								$Ok .= '::' . $Oh->ptype () . ':0';
							}
						}
					}
					$l5 = ltrim ( $l5, '::' );
					$ll = 'EventLikeShow';
					$lm = 0;
					$O4 = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$l4 = $Ob;
					$l4 = trim ( $l4 );
					if (empty ( $Od )) {
						$Om = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$ln = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Om . '&surl=' . $O4 . '&type=sitepage&ptype=' . $l5;
						if (empty ( $On )) {
							$lo = curl_init ();
							$Oo = 0;
							curl_setopt ( $lo, CURLOPT_URL, $ln );
							curl_setopt ( $lo, CURLOPT_CONNECTTIMEOUT, $Oo );
							ob_start ();
							curl_exec ( $lo );
							curl_close ( $lo );
							$lp = ob_get_contents ();
							if (empty ( $lp )) {
								$lp = @file_get_contents ( $ln );
							}
							ob_end_clean ();
						}
						if (! strstr ( $lp, strrev ( 'sitepage' ) )) {
							$Op = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$lq = 1;
						}
						if (empty ( $lq )) {
							if (empty ( $l2 )) {
								$O2 = 'meraMODULE' . $l3 . 'plugin.php';
							} else {
								$O2 = 'simpleMODULE' . $l3 . 'plugin.php';
							}
							$O3 = 'http://www.socialengineaddons.com/' . $O2 . '?checking=' . $l4 . '&surl=' . $O4 . '&type=' . $l3 . '&ptype=' . $l5;
							$O5 = 'ASDsdas';
							$l6 = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $O5;
							if (empty ( $get_value )) {
								$O6 = $O3;
								$l7 = curl_init ();
								$O7 = 0;
								curl_setopt ( $l7, CURLOPT_URL, $O6 );
								curl_setopt ( $l7, CURLOPT_CONNECTTIMEOUT, $O7 );
								ob_start ();
								curl_exec ( $l7 );
								curl_close ( $l7 );
								if (empty ( $l8 )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $O3 );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oq = strrev ( $l3 );
					if (strstr ( $get_value, $Oq )) {
						$lr = array ('host_att' => $O4, 'auth_att' => 1, 'is_att' => 1 );
						$ls = serialize ( $lr );
						$Os = convert_uuencode ( $ls );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.recentphoto.info', $Os );
						$lt = convert_uuencode ( $O4 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagealbum.image.type', $lt );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.lsettings', $Ob );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagealbum' );
						$Ot = 0;
						if (empty ( $l2 )) {
							$lu = explode ( '::', $get_value );
							if (! empty ( $lu )) {
								$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$lv = $O9->info ( 'name' );
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$lu = explode ( ';', $lu );
								foreach ( $lu as $lw ) {
									if (! empty ( $lw )) {
										$Ou->query ( $lw );
									}
								}
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_main_manage';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Manage Page Albums';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 2;
								$Ow->save ();
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_main_level';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Member Level Settings';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 3;
								$Ow->save ();
							}
							$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
							$Ov = $select->query ()->fetchall ();
							if (empty ( $Ov )) {
								$Ow = $O9->createrow ();
								$Ow->name = 'sitepagealbum_admin_widget_settings';
								$Ow->module = 'sitepagealbum';
								$Ow->label = 'Widget Settings';
								$Ow->plugin = '';
								$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
								$Ow->menu = 'sitepagealbum_admin_main';
								$Ow->submenu = '';
								$Ow->order = 4;
								$Ow->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$lx = $select->query ()->fetchall ();
							if (! empty ( $lx )) {
								$Ox = $lx [0] ['value'];
							} else {
								$Ox = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$ly = $select->query ()->fetchobject ();
							if (! empty ( $ly ) && ! empty ( $Ox )) {
								$select = new Zend_Db_Select ( $db );
								$Oy = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $Oy->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$l12 = $O11->query ()->fetchall ();
											if (! empty ( $l12 )) {
												$O12 = $l12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$l13 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$O13 = $l13->query ()->fetchall ();
												if (! empty ( $O13 )) {
													$l14 = $O13 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
												$select = new Zend_Db_Select ( $db );
												$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
												$O14 = $select->query ()->fetchall ();
												foreach ( $O14 as $l15 ) {
													if (! empty ( $l15 )) {
														$page_id = $l15 ['contentpage_id'];
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																$l12 = $O11->query ()->fetchall ();
																if (! empty ( $l12 )) {
																	$O12 = $l12 [0] ['content_id'];
																	$select = new Zend_Db_Select ( $db );
																	$l13 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																	$O13 = $l13->query ()->fetchall ();
																	if (! empty ( $O13 )) {
																		$l14 = $O13 [0] ['content_id'];
																	}
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
																}
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
													$Oz = $lz->query ()->fetchall ();
													if (empty ( $Oz )) {
														$select = new Zend_Db_Select ( $db );
														$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$O10 = $l10->query ()->fetchall ();
														if (! empty ( $O10 )) {
															$l11 = $O10 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O15 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$l16 = $O15->query ()->fetchall ();
															if (! empty ( $l16 )) {
																$O16 = $l16 [0] ['content_id'];
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
													$Oz = $lz->query ()->fetchall ();
													if (empty ( $Oz )) {
														$select = new Zend_Db_Select ( $db );
														$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$O10 = $l10->query ()->fetchall ();
														if (! empty ( $O10 )) {
															$l11 = $O10 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$l12 = $O11->query ()->fetchall ();
															if (! empty ( $l12 )) {
																$O12 = $l12 [0] ['content_id'];
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
															}
														}
													}
												}
											}
										}
									}
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O15 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$l16 = $O15->query ()->fetchall ();
											if (! empty ( $l16 )) {
												$O16 = $l16 [0] ['content_id'];
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":""}' ) );
											}
										}
									}
									$select = new Zend_Db_Select ( $db );
									$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
									$Oz = $lz->query ()->fetchall ();
									if (empty ( $Oz )) {
										$select = new Zend_Db_Select ( $db );
										$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$O10 = $l10->query ()->fetchall ();
										if (! empty ( $O10 )) {
											$l11 = $O10 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$l12 = $O11->query ()->fetchall ();
											if (! empty ( $l12 )) {
												$O12 = $l12 [0] ['content_id'];
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $lc )) {
								$l17 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $l17 )) {
									$O17 = include $l17;
								} else {
									$O17 = array ();
								}
								if (! is_writable ( $l17 )) {
									@chmod ( $l17, 0666 );
								}
								$O17 ['environment_mode'] = 'development';
								$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$l18 .= var_export ( $O17, TRUE );
								$l18 .= '; ?>';
								@file_put_contents ( $l17, $l18 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $form->getvalues ();
								if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
									engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
								}
							}
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if (empty ( $l2 )) {
								$lu = explode ( '::', $get_value );
								if (! empty ( $lu )) {
									$lu = $lu [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
								}
								$Ou = Zend_Db_Table_Abstract::getdefaultadapter ();
								$O9 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
								$lv = $O9->info ( 'name' );
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagealbum' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$lu = explode ( ';', $lu );
									foreach ( $lu as $lw ) {
										if (! empty ( $lw )) {
											$Ou->query ( $lw );
										}
									}
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_manage' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_main_manage';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Manage Page Albums';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"manage","action":"index"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 2;
									$Ow->save ();
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_main_level' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_main_level';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Member Level Settings';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"level"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 3;
									$Ow->save ();
								}
								$select = $O9->select ()->from ( $lv, array ('id' ) )->where ( 'name = ?', 'sitepagealbum_admin_widget_settings' );
								$Ov = $select->query ()->fetchall ();
								if (empty ( $Ov )) {
									$Ow = $O9->createrow ();
									$Ow->name = 'sitepagealbum_admin_widget_settings';
									$Ow->module = 'sitepagealbum';
									$Ow->label = 'Widget Settings';
									$Ow->plugin = '';
									$Ow->params = '{"route":"admin_default","module":"sitepagealbum","controller":"widgets"}';
									$Ow->menu = 'sitepagealbum_admin_main';
									$Ow->submenu = '';
									$Ow->order = 4;
									$Ow->save ();
								}
								$db = Zend_Db_Table_Abstract::getdefaultadapter ();
								$select = new Zend_Db_Select ( $db );
								$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
								$lx = $select->query ()->fetchall ();
								if (! empty ( $lx )) {
									$Ox = $lx [0] ['value'];
								} else {
									$Ox = 0;
								}
								$select = new Zend_Db_Select ( $db );
								$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
								$ly = $select->query ()->fetchobject ();
								if (! empty ( $ly ) && ! empty ( $Ox )) {
									$select = new Zend_Db_Select ( $db );
									$Oy = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
									$page = $Oy->query ()->fetchall ();
									if (! empty ( $page )) {
										$page_id = $page [0] ['page_id'];
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
												$l12 = $O11->query ()->fetchall ();
												if (! empty ( $l12 )) {
													$O12 = $l12 [0] ['content_id'];
													$select = new Zend_Db_Select ( $db );
													$l13 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
													$O13 = $l13->query ()->fetchall ();
													if (! empty ( $O13 )) {
														$l14 = $O13 [0] ['content_id'];
													}
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
													$select = new Zend_Db_Select ( $db );
													$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
													$O14 = $select->query ()->fetchall ();
													foreach ( $O14 as $l15 ) {
														if (! empty ( $l15 )) {
															$page_id = $l15 ['contentpage_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photos-sitepage' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (empty ( $Oz )) {
																$select = new Zend_Db_Select ( $db );
																$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
																$O10 = $l10->query ()->fetchall ();
																if (! empty ( $O10 )) {
																	$l11 = $O10 [0] ['content_id'];
																	$select = new Zend_Db_Select ( $db );
																	$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																	$l12 = $O11->query ()->fetchall ();
																	if (! empty ( $l12 )) {
																		$O12 = $l12 [0] ['content_id'];
																		$select = new Zend_Db_Select ( $db );
																		$l13 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																		$O13 = $l13->query ()->fetchall ();
																		if (! empty ( $O13 )) {
																			$l14 = $O13 [0] ['content_id'];
																		}
																		$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photos-sitepage', 'parent_content_id' => ($l14 ? $l14 : $O12), 'order' => 0156, 'params' => '{"title":"Photos","titleCount":"true"}' ) );
																	}
																}
															}
														}
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O15 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
																$l16 = $O15->query ()->fetchall ();
																if (! empty ( $l16 )) {
																	$O16 = $l16 [0] ['content_id'];
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":"true"}' ) );
																}
															}
														}
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (empty ( $Oz )) {
															$select = new Zend_Db_Select ( $db );
															$l10 = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
															$O10 = $l10->query ()->fetchall ();
															if (! empty ( $O10 )) {
																$l11 = $O10 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O11 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
																$l12 = $O11->query ()->fetchall ();
																if (! empty ( $l12 )) {
																	$O12 = $l12 [0] ['content_id'];
																	$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
																}
															}
														}
													}
												}
											}
										}
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.albums-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O15 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
												$l16 = $O15->query ()->fetchall ();
												if (! empty ( $l16 )) {
													$O16 = $l16 [0] ['content_id'];
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.albums-sitepage', 'parent_content_id' => $O16, 'order' => 031, 'params' => '{"title":"Albums","titleCount":""}' ) );
												}
											}
										}
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepage.photorecent-sitepage' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (empty ( $Oz )) {
											$select = new Zend_Db_Select ( $db );
											$l10 = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
											$O10 = $l10->query ()->fetchall ();
											if (! empty ( $O10 )) {
												$l11 = $O10 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O11 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $l11 )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
												$l12 = $O11->query ()->fetchall ();
												if (! empty ( $l12 )) {
													$O12 = $l12 [0] ['content_id'];
													$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepage.photorecent-sitepage', 'parent_content_id' => $O12, 'order' => 4, 'params' => '{"title":"","titleCount":""}' ) );
												}
											}
										}
									}
								}
								if (! empty ( $lc )) {
									$l17 = APPLICATION_PATH . '/application/settings/general.php';
									if (file_exists ( $l17 )) {
										$O17 = include $l17;
									} else {
										$O17 = array ();
									}
									if (! is_writable ( $l17 )) {
										@chmod ( $l17, 0666 );
									}
									$O17 ['environment_mode'] = 'development';
									$l18 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
									$l18 .= var_export ( $O17, TRUE );
									$l18 .= '; ?>';
									@file_put_contents ( $l17, $l18 );
								}
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.navi.auth', 1 );
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $l3 . '.isActivate', 1 );
								if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
									$values = $form->getvalues ();
									if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
										engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
									}
								}
								$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
								if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
									$values = $form->getvalues ();
									if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
										unset ( $values ['sitepagealbum_show_activitymanual'] );
									}
									if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
										$Ot = 1;
									}
									if (! empty ( $Ot )) {
										$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
										$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
										if (is_file ( $O18 )) {
											@chmod ( $O18, 0777 );
										}
										if (! @copy ( $l19, $O18 )) {
										}
									}
									if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
										engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
									}
									foreach ( $values as $key => $value ) {
										if ($key != 'submit') {
											engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
										}
									}
									$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
								}
							}
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $form->getvalues ();
								if (array_key_exists ( 'sitepagealbum_show_activitymanual', $values )) {
									unset ( $values ['sitepagealbum_show_activitymanual'] );
								}
								if (isset ( $values ['sitepagealbum_photolightbox_activityedit'] ) && ! empty ( $values ['sitepagealbum_photolightbox_activityedit'] )) {
									$Ot = 1;
								}
								if (! empty ( $Ot )) {
									$O18 = APPLICATION_PATH . '/application/modules/Activity/views/scripts/_activityText.tpl';
									$l19 = APPLICATION_PATH . '/application/modules/Sitepagealbum/settings/sitepagealbum_activityfeed/_activityText.tpl';
									if (is_file ( $O18 )) {
										@chmod ( $O18, 0777 );
									}
									if (! @copy ( $l19, $O18 )) {
									}
								}
								if (engine_api::_ ()->sitepage ()->haspackageenable () && isset ( $values ['include_in_package'] ) && ! empty ( $values ['include_in_package'] )) {
									engine_api::_ ()->sitepage ()->oninstallpackageenablesubmodules ( 'sitepagealbum' );
								}
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
								$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default', 'action' => 'index', 'controller' => 'settings' ) );
							}
						}
						$Oa = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$Oa = str_replace ( 'error::', '', $get_value );
					} else {
						$Oa = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $Op )) {
				$lm = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $Op;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $Oa )) {
				$lm = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $Oa;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		}
	 endif;
 endif;
?>
